'use strict';
var url = require('url');
console.log(url.parse('http://user:pass@host.com:8080/path/to/file?query=string#hash'));

var path =require('path');
//解析当前目录
var workDir = path.resolve('.');//d:\test\web
console.log(workDir);
//组合完整的文件路径,当前路径目录+'pub'+'index.html'
var filePath = path.join(workDir,'pub','index.html');
//d:\test\web\pub\index.html
console.log(filePath);
console.log('cwd: ' + process.cwd());

//   http://user:pass@host.com:8080/path/to/file?query=string#hash
//   Url {
//   protocol: 'http:',
//   slashes: true,
//   auth: 'user:pass',
//   host: 'host.com:8080',
//   port: '8080',
//   hostname: 'host.com',
//   hash: '#hash',
//   search: '?query=string',
//   query: 'query=string',
//   pathname: '/path/to/file',
//   path: '/path/to/file?query=string',
//   href: 'http://user:pass@host.com:8080/path/to/file?query=string#hash' }